﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sunny.Controls
{
	public class Pager_LastPageEnableConverter : System.Windows.Data.IValueConverter
	{
		#region IValueConverter 成员

		object System.Windows.Data.IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			//return false;
			Telerik.Windows.Controls.RadDataPager pager = (Telerik.Windows.Controls.RadDataPager)value;
			return pager.PageIndex == pager.PageCount - 1 ? false : true;
		}

		object System.Windows.Data.IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			return (bool)value ? 0 : 1;
		}

		#endregion
	}
}